<?php

class App_Controllers_page
{
    private $_template;
    private $_models = array();

    public function  __construct()
    {

    }

    public function index(Core_Request $request)
    {

        $this->_template = new Core_Template();


        $this->_template->add_css_file(array('/App/Views/index.css',
                                            '/App/Views/page/page.css'                                        
                                ));
     

        $this->_template->set_title("театр теней fireflies");

        $this->_template->get_smarty()->assign('title',$this->_template->get_title());
        $this->_template->get_smarty()->assign('css_file',$this->_template->get_css_file());
        $this->_template->get_smarty()->assign('js_file',$this->_template->get_js_file());

        if (isset($request->params['id'])) {
         
            if (!strcmp("1",$request->params['id'])) {
                $this->_template->get_smarty()->assign('content','page/about');
            }

            if (!strcmp("2",$request->params['id'])) {
                $this->_template->get_smarty()->assign('content','page/r');
            }

            if (!strcmp("3",$request->params['id'])) {
                $this->_template->get_smarty()->assign('content','page/contacts');
            }          
        } else {
            $this->_template->error_page();
        }
        $this->_template->get_smarty()->display('index.tpl');

    }

    public function __call($name, $args)
    {
        $this->_template = new Core_Template();
        $this->_template->error_page();
    }
}

?>
